@extends('layouts.template')

@section('title', '待报价订单')

@section('header')
@endsection

@section('content')
<script src="{{asset('dist/order/detail.js')}}"></script>
<script>
    var employ_time = '{{$order->pay_time ? $order->pay_time->timestamp : ''}}';
    var appoint_time = '{{$order->status->appoint_time ? $order->status->appoint_time->timestamp : ''}}';
    var finish_time = '{{$order->status->finish_time ? $order->status->finish_time->timestamp : ''}}';
    var success_time = '{{$order->status->order_success_time ? $order->status->order_success_time->timestamp : ''}}';
</script>
<div>

    <article id="article" v-cloak>
        <div class="order_s1 overflow_h" style=" padding-bottom:1%">
            <div class="barx"></div>
            <ul class="or_ul border_r">
                <li><div class="or_ico or_ico01"></div>
                    <div class="order_s2">
                        <h2>成功雇佣</h2>
                        <p>@{{employ_time | date('MM-DD HH:mm:ss')}}</p>
                    </div></li>

                <li v-if="appoint_time"><div class="or_ico or_ico02"></div>
                    <div class="order_s2">
                        <h2>预约客户</h2>
                        <p>@{{appoint_time | date('MM-DD HH:mm:ss')}}</p>
                    </div></li>
                <li v-else><div class="or_ico or_ico02_h"></div>
                    <div class="order_s2">
                        <h2>预约客户</h2>
                    </div></li>

                <li v-if="finish_time"><div class="or_ico or_ico03"></div>
                    <div class="order_s2 ">
                        <h2>完成服务</h2>
                        <p>@{{finish_time | date('MM-DD HH:mm:ss')}}</p>
                    </div></li>
                <li v-else><div class="or_ico or_ico03_h"></div>
                    <div class="order_s2 ">
                        <h2>完成服务</h2>
                    </div></li>

                <li v-if="success_time" class="mar_or1"><div class="or_ico or_ico04" ></div>
                    <div class="order_s2">
                        <h2>收款到账</h2>
                        <p>@{{success_time | date('MM-DD HH:mm:ss')}}</p>
                    </div></li>
                <li v-else class="mar_or1"><div class="or_ico or_ico04_h" ></div>
                    <div class="order_s2">
                        <h2>收款到账</h2>
                    </div></li>
            </ul>

        </div>

        @if ($order->status->employed)
            <a href="{{url("order/appoint/{$order->id}")}}" class="but14">点击预约客户</a>
        @elseif ($order->status->appointed && $order->need_delivery)
            <a href="{{url("order/delivery/{$order->id}")}}" class="but14">点击物流提货</a>
        @elseif (($order->status->appointed && !$order->need_delivery) || $order->status->delivered)
            <a href="{{url("order/finish/{$order->id}")}}" class="but14">点击确认完成</a>
        @else
            <!-- -->
        @endif

    </article>

    @component('order.layouts.orderDetail',['order'=>$order])
    @endcomponent

</div>

@endsection